import App from '../App'

const home = r => require.ensure([], () => r(require('../page/home/home')), 'home')
const addFriend = r => require.ensure([], () => r(require('../page/addFriend/addFriend')), 'addFriend')
const friendCheck = r => require.ensure([], () => r(require('../page/friendCheck/friendCheck')), 'friendCheck')
const friendDetail = r => require.ensure([], () => r(require('../page/friendDetail/friendDetail')), 'friendDetail')
const personal = r => require.ensure([], () => r(require('../page/personal/personal')), 'personal')
const signature = r => require.ensure([], () => r(require('../page/signature/signature')), 'signature')
const friendList = r => require.ensure([], () => r(require('../page/friendList/friendList')), 'friendList')
const friendAddWay = r => require.ensure([], () => r(require('../page/friendAddWay/friendAddWay')), 'friendAddWay')
const blackItem = r => require.ensure([], () => r(require('../page/blackItem/blackItem')), 'blackItem')
const groupDetail = r => require.ensure([], () => r(require('../page/groupDetail/groupDetail')), 'groupDetail')
const groupList = r => require.ensure([], () => r(require('../page/groupList/groupList')), 'groupList')
const newFriend = r => require.ensure([], () => r(require('../page/newFriend/newFriend')), 'newFriend')
const createGroup = r => require.ensure([], () => r(require('../page/createGroup/createGroup')), 'createGroup')
const groupMemberList = r => require.ensure([], () => r(require('../page/groupMemberList/groupMemberList')), 'groupMemberList')
const groupMemberdetails = r => require.ensure([], () => r(require('../page/groupMemberdetails/groupMemberdetails')), 'groupMemberdetails')
const groupAddMemberFromFriends = r => require.ensure([], () => r(require('../page/groupAddMemberFromFriends/groupAddMemberFromFriends')), 'groupAddMemberFromFriends')
const addGroup = r => require.ensure([], () => r(require('../page/addGroup/addGroup')), 'addGroup')
const addGroupQuestion = r => require.ensure([], () => r(require('../page/addGroupQuestion/addGroupQuestion')), 'addGroupQuestion')
const editGroupdetail = r => require.ensure([], () => r(require('../page/editGroupdetail/editGroupdetail')), 'editGroupdetail')
const session = r => require.ensure([], () => r(require('../page/session/session')), 'session')
const groupApplyJoinList = r => require.ensure([], () => r(require('../page/groupApplyJoinList/groupApplyJoinList')), 'groupApplyJoinList')
const groupApplyJoinCheck = r => require.ensure([], () => r(require('../page/groupApplyJoinCheck/groupApplyJoinCheck')), 'groupApplyJoinCheck')
const groupSession = r => require.ensure([], () => r(require('../page/groupSession/groupSession')), 'groupSession')

//新页面
const recentContactList = r => require.ensure([], () => r(require('../page/recentContactList/recentContactList')), 'recentContactList')
const modifyGroupDetails = r => require.ensure([], () => r(require('../page/modifyGroupDetails/modifyGroupDetails')), 'modifyGroupDetails')
//新页面
export default [{
    path: '/',
    component: App, //顶层路由，对应index.html
    children: [ //二级路由。对应App.vue
        //地址为空时跳转home页面
        {
            path: '',
            redirect: '/home'
        },
        //首页消息列表
        {
            path: '/home',
            component: home
        },
        //聊天窗口
        {
            path: '/session',
            component: session
        },
        //好友列表
        {
            path: '/friendList',
            component: friendList
        },
        //个人主页
        {
            path: '/personal',
            component: personal
        },
        //添加好友
        {
            path: '/addFriend',
            component: addFriend
        },
        //好友验证
        {
            path: '/friendCheck',
            component: friendCheck
        },
         //好友详情
         {
            path: '/friendDetail',
            component: friendDetail
        },
        //个性签名
        {
            path: '/signature',
            component: signature
        },
        //好友添加方式
        {
            path: '/friendAddWay',
            component: friendAddWay
        },
        //黑名单
        {
            path: '/blackItem',
            component: blackItem
        },
        // 创建群createGroup
        {
            path: '/createGroup',
            component: createGroup
        },
        //群详情
        {
            path: '/groupDetail',
            component: groupDetail
        },
        // 编辑群组详情
        {
            path: '/editGroupdetail',
            component: editGroupdetail
        },
        //群列表
        {
            path: '/groupList',
            component: groupList
        },
        //群成员列表
        {
            path: '/groupMemberList',
            component: groupMemberList
        },
        // 申请请加群
        {
            path: '/addGroup',
            component: addGroup
        },
        //群成员详情
        {
            path: '/groupMemberdetails',
            component: groupMemberdetails
        },

        //群组添加成员
        {
            path: '/groupAddMemberFromFriends',
            component: groupAddMemberFromFriends
        },

        //申请加群问题
        {
            path: '/addGroupQuestion',
            component: addGroupQuestion
        },
        // 群组申请加入列表
        {
            path: '/groupApplyJoinList',
            component: groupApplyJoinList
        },

        // 群组加群审核
        {
            path: '/groupApplyJoinCheck',
            component: groupApplyJoinCheck
        },

        // 群组回话
        {
            path: '/groupSession',
            component: groupSession
        },

         //新的朋友
         {
            path: '/newFriend',
            component: newFriend
        },
        
        //新页面
        //新页面最近联系人
        {
            path: '/recentContactList',
            component: recentContactList
        },

        // 群组或管理员修改群组详情的页面
        {
            path: '/modifyGroupDetails',
            component: modifyGroupDetails
        },
        /*,
        //所有商铺列表页
        {
            path: '/msite',
            component: msite,
            meta: { keepAlive: true },
        },
        //特色商铺列表页
        {
            path: '/food',
            component: food
        },
        //搜索页
        {
            path: '/search/:geohash',
            component: search
        },
        //商铺详情页
        {
            path: '/shop',
            component: shop,
            children: [{
                path: 'foodDetail', //食品详情页
                component: foodDetail,
            }, {
                path: 'shopDetail', //商铺详情页
                component: shopDetail,
                children: [{
                    path: 'shopSafe', //商铺安全认证页
                    component: shopSafe,
                }, ]
            }]
        },
        //确认订单页
        {
            path: '/confirmOrder',
            component: confirmOrder,
            children: [{
                path: 'remark', //订单备注
                component: remark,
            }, {
                path: 'invoice', //发票抬头
                component: invoice,
            }, {
                path: 'payment', //付款页面
                component: payment,
            }, {
                path: 'userValidation', //用户验证
                component: userValidation,
            }, {
                path: 'chooseAddress', //选择地址
                component: chooseAddress,
                children: [{
                    path: 'addAddress', //添加地址
                    component: addAddress,
                    children: [{
                        path: 'searchAddress', //搜索地址
                        component: searchAddress,
                    }]
                }, ]
            }, ]
        },
        //登录注册页
        {
            path: '/login',
            component: login
        },
        //个人信息页
        {
            path: '/profile',
            component: profile,
            children: [{
                path: 'info', //个人信息详情页
                component: info,
                children: [{
                    path: 'address',
                    component: address,     //编辑地址
                    children:[{
                        path:'add',
                        component:add,
                        children:[{
                            path:'addDetail',
                            component:addDetail
                        }]
                    }]
                }]
            },
            {
                path: 'setusername',
                component: setusername,
            },
            {
                path: 'service', //服务中心
                component: service,
            },]
        },
        //修改密码页
        {
            path: '/forget',
            component: forget
        },
        //订单列表页
        {
            path: '/order',
            component: order,
            children: [{
                path: 'orderDetail', //订单详情页
                component: orderDetail,
            }, ]
        },
        //vip卡页
        {
            path: '/vipcard',
            component: vipcard,
            children: [{
                path: 'invoiceRecord', //开发票
                component: invoiceRecord,
            }, {
                path: 'useCart', //购买会员卡
                component: useCart,
            }, {
                path: 'vipDescription', //会员说明
                component: vipDescription,
            },]
        },
        //发现页
        {
            path: '/find',
            component: find
        },
        //下载页
        {
            path: '/download',
            component: download
        },
        //服务中心
        {
            path: '/service',
            component: service,
             children: [{
                path: 'questionDetail', //订单详情页
                component: questionDetail,
            }, ]
        },
        //余额
        {
            path: 'balance',
            component: balance,
            children: [{
                path: 'detail', //余额说明
                component: balanceDetail,
            }, ]
        },
        //我的优惠页
        {
            path: 'benefit',
            component: benefit,
            children: [{
                path: 'coupon', //代金券说明
                component: coupon,
            }, {
                path: 'hbDescription', //红包说明
                component: hbDescription,
            }, {
                path: 'hbHistory', //历史红包
                component: hbHistory,
            }, {
                path: 'exchange', //兑换红包
                component: exchange,
            }, {
                path: 'commend', //推荐有奖
                component: commend,
            },]
        },
        //我的积分页
        {
            path: 'points',
            component: points,
            children: [{
                path: 'detail', //积分说明
                component: pointsDetail,
            }, ]
        },*/
    ]
}]